package com.android.support.lib.universal.sdk.weixin.wxapi;

public class WeixinManager {
	private static WeixinManager sManager;
	public static String mPayTheGoodName;
	public static String mPayTheMoney;

	private WeixinManager() {
	}

	public static WeixinManager getInstance() {
		if (null == sManager) {
			sManager = new WeixinManager();
		}
		return sManager;
	}

	/**
	 * 支付参数
	 * 
	 * @param mPayTheGoodName
	 *            商品名
	 * @param payTheMoney
	 *            金额。 数值1 对应 微信的0.01
	 */
	public void pay(String mPayTheGoodName, String payTheMoney) {
		this.mPayTheGoodName = mPayTheGoodName;
		this.mPayTheMoney = payTheMoney;
	}

	private WeixinManagerListener mWeixinManagerListener;

	public void setWeixinmanagerListener(WeixinManagerListener listener) {
		mWeixinManagerListener = listener;
	}

	public interface WeixinManagerListener {
		public void onPaySuccess();

		public void onPayFailed();
	}

	public void onPaySuccess() {
		if (mWeixinManagerListener != null) {
			mWeixinManagerListener.onPaySuccess();
		}
	}

	public void onPayFailed() {
		if (mWeixinManagerListener != null) {
			mWeixinManagerListener.onPayFailed();
		}
	}
}
